package org.anti996.bankms.model;

import org.anti996.bankms.dao.UserDao;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Card {
    private int id;
    private String username;
    private double balance;
    private String currency;
    private Timestamp card_open;
    private Timestamp card_close;

    public static String describe(Card card) {
        return String.format("卡号：%s，币种：%s，余额：%.2f，开卡时间：%s", card.getId(), UserDao.CURRENCY_NAMES.get(card.getCurrency()), card.getBalance(), card.getCard_open());
    }
}
